home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************************\
-
- CMIO.h
-
- [Macintosh]
-
- Routines for doing A/D conversion with National Instruments
- NB-MIO-16 card.
- Written by Dan Crevier, 1994
-
- See CMIO.cpp for usage details
-
- \*********************************************************************/
-
- #pragma once
-
- class CMIO
- {
- public:
-
- short Config(void);
-
- short SampleAvailable(short *error);
- short GetSample(void) { return *ADFIFOReg; };
- void StartCollection(void);
- void EndCollection(void);
- void ConfigureCollection(unsigned short *channelArray, unsigned short sampleInterval,
- unsigned long nSamples);
-
- private:
-
- // Configuration and Status Registers
- unsigned short *comReg1, *comReg2, *statReg;
- // Event Strobe Register Group
- unsigned short *startConvReg, *startDAQReg, *ADClearReg, *exStrobeReg;
- // Analog Output Register Group
- unsigned short *DAC0Reg, *DAC1Reg, *DAC01Reg;
- // Analog Input Register Group
- unsigned short *MUXCounterReg, *MUXGainReg, *ADFIFOReg;
- // Counter/Timer (AM9513) Register Group
- unsigned short *AmDataReg, *AmCommandReg, *AmStatusReg;
-
- unsigned short comRegVal;
- };
-
- // •• Error codes ••
- const short kErrOverflow = 1 << 9;
- const short kErrOverrun = 1 << 8;
-
- // •• Other defines ••
- const short kCONVAVAIL = 1 << 13;
-
- // •• Command Register 1 values ••
- const short kDAQEN = 16;
- const short kSCANEN = 8;
- const short k1632CNT = 2;
-